package com.shareloke.demo.tpl;

import org.springframework.stereotype.Service;
import xyz.erupt.annotation.sub_erupt.Tpl;
import xyz.erupt.tpl.annotation.EruptTpl;
import xyz.erupt.tpl.annotation.TplAction;

import java.util.HashMap;
import java.util.Map;

/**
 * 描述：自定义页面
 *
 * @author shareloke
 * @time 2024/11/4 02:18
 */
@EruptTpl(engine = Tpl.Engine.FreeMarker)
@Service
public class TestTplAction {

    @TplAction(value = "demo", path = "/tpl/demo/demo.ftl")
    public Map<String, Object> demo() {
        Map<String, Object> map = new HashMap<>();
        map.put("user", "shareloke");
        return map;
    }

    @TplAction(value = "vue3SfcLoaderDemo", path = "/tpl/demo/vue3-sfc-loader-demo.ftl")
    public Map<String, Object> vueSfcLoaderDemo() {
        Map<String, Object> map = new HashMap<>();
        map.put("user", "shareloke");
        return map;
    }
}
